package com.itcam.thread_.single_design;

public class SingleDesignDemo1 {
    /*
        单例设计模式 - 饿汉式

        -----------------------------------------------------------------

        class Single1 {
            private Single1() {
            }

            public static final Single1 s = new Single1();
        }

        -----------------------------------------------------------------
     */
    public static void main(String[] args) {
        Single1 s = Single1.getInstance();
    }
}

class Single1 {
    private Single1() {
    }

    private static Single1 s = new Single1();

    public static Single1 getInstance() {
        return s;
    }
}